-------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /homes/nber/jetson-dua57641/gruber-DUA57641/jetson-dua57641/ambula
> nce/replication/logs/district_regs.log
  log type:  text
 opened on:  16 Jul 2024, 14:49:40

. 
. /****************************************************************************
> ***
> district_regs.do
> 
> This code runs district-level regressions
> *****************************************************************************
> **/
. 
. use "${cleandatapath}ambulancetaxis_firmpanel_enforcement.dta", clear

. 
. qui gen firmactive = 1 if linepmt > 0

. 
. collapse (sum) firmactive (min) district_treat_civil (min) district_treat_cri
> minal (min) padate, by(district month)

. 
. gen postpa = (month >= padate & !mi(padate))

. gen postcrim = (month >= mofd(district_treat_criminal) & !mi(padate))

. gen postciv = (month >= mofd(district_treat_civil) & !mi(padate))

. 
. encode district, gen(dist_code)

. 
. *********************************************
. *** Civil enforcement DD
. 
. qui {

. 
. *Dynamic
. reghdfe lfirm ib99.reltime_civ2 postpa postcrim, absorb(district month) vce(c
> luster district) // Used in Figure A18b
note: 50bn.reltime_civ2 is probably collinear with the fixed effects (all parti
> alled-out values are close to zero; tol = 1.0e-09)
(MWFE estimator converged in 5 iterations)
note: 50.reltime_civ2 omitted because of collinearity

HDFE Linear regression                            Number of obs   =     12,143
Absorbing 2 HDFE groups                           F(  49,     86) =      63.20
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.9102
                                                  Adj R-squared   =     0.9080
                                                  Within R-sq.    =     0.0224
Number of clusters (district) =         87        Root MSE        =     0.3648

                              (Std. err. adjusted for 87 clusters in district)
------------------------------------------------------------------------------
             |               Robust
       lfirm | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
reltime_civ2 |
         50  |          0  (omitted)
         76  |   .0774507   .1320976     0.59   0.559    -.1851506     .340052
         77  |  -.0106794   .1318968    -0.08   0.936    -.2728815    .2515227
         78  |  -.0021771   .1269432    -0.02   0.986    -.2545318    .2501775
         79  |   .0006894   .1304294     0.01   0.996    -.2585958    .2599745
         80  |   .0594871   .1247286     0.48   0.635    -.1884651    .3074392
         81  |   .0687512   .1191257     0.58   0.565     -.168063    .3055653
         82  |   .0649855   .1204337     0.54   0.591    -.1744287    .3043996
         83  |  -.0280148   .1216923    -0.23   0.818    -.2699311    .2139015
         84  |   .0100127   .1050154     0.10   0.924     -.198751    .2187764
         85  |   .0514865   .0943672     0.55   0.587    -.1361092    .2390823
         86  |   .0461303   .0919088     0.50   0.617    -.1365783    .2288389
         87  |   .0231952   .1042457     0.22   0.824    -.1840384    .2304287
         88  |   .0661827   .0890893     0.74   0.460     -.110921    .2432864
         89  |   .0963315   .0948961     1.02   0.313    -.0923156    .2849786
         90  |   .0314718   .0872664     0.36   0.719     -.142008    .2049517
         91  |   .0775342   .0921682     0.84   0.403    -.1056901    .2607584
         92  |   .0688942   .0934769     0.74   0.463    -.1169318    .2547202
         93  |    .097636   .0882661     1.11   0.272    -.0778312    .2731031
         94  |   .1041944   .0833187     1.25   0.214    -.0614377    .2698265
         95  |   .0872717    .079268     1.10   0.274    -.0703079    .2448513
         96  |   .0537977   .0664144     0.81   0.420    -.0782298    .1858252
         97  |   .0024343   .0496965     0.05   0.961     -.096359    .1012276
         98  |  -.0195693   .0373568    -0.52   0.602    -.0938321    .0546935
        100  |   .0157049   .0398082     0.39   0.694    -.0634312     .094841
        101  |  -.0085397   .0329128    -0.26   0.796    -.0739682    .0568888
        102  |   .0263144   .0400775     0.66   0.513    -.0533569    .1059858
        103  |    .018989   .0365458     0.52   0.605    -.0536618    .0916397
        104  |   .0298541   .0432753     0.69   0.492    -.0561743    .1158825
        105  |   .0761345   .0317671     2.40   0.019     .0129836    .1392854
        106  |   .0462703   .0416392     1.11   0.270    -.0365056    .1290463
        107  |   .0146894   .0363984     0.40   0.688    -.0576683    .0870471
        108  |   .0532449   .0489688     1.09   0.280    -.0441019    .1505916
        109  |  -.0274861   .0484355    -0.57   0.572    -.1237726    .0688005
        110  |  -.0402403   .0434478    -0.93   0.357    -.1266117    .0461311
        111  |  -.0130546   .0380746    -0.34   0.733    -.0887445    .0626352
        112  |  -.0783442   .0599734    -1.31   0.195    -.1975674    .0408789
        113  |  -.0194587   .0405134    -0.48   0.632    -.0999967    .0610793
        114  |  -.0313874   .0502442    -0.62   0.534    -.1312695    .0684947
        115  |  -.0415347   .0413778    -1.00   0.318     -.123791    .0407216
        116  |  -.0027668   .0453784    -0.06   0.952     -.092976    .0874424
        117  |   .0269179   .0598538     0.45   0.654    -.0920674    .1459033
        118  |   .0484709   .0548974     0.88   0.380    -.0606616    .1576034
        119  |  -.0014068   .0535557    -0.03   0.979    -.1078719    .1050584
        120  |    .053352   .0629409     0.85   0.399    -.0717704    .1784743
        121  |   .0774887   .0513951     1.51   0.135    -.0246813    .1796587
        122  |    .052279   .0580565     0.90   0.370    -.0631335    .1676915
        123  |   .0155726   .0556399     0.28   0.780    -.0950357     .126181
             |
      postpa |  -.3545679   .1501667    -2.36   0.020    -.6530895   -.0560462
    postcrim |    .280417   .0883341     3.17   0.002     .1048145    .4560194
       _cons |   1.306016   .0063611   205.31   0.000     1.293371    1.318662
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
    district |        87          87           0    *|
       month |       156           0         156     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. coefplot, vertical baselevels keep(*reltime*) recast(connected) ciopts(recast
> (rcap) color(navy)) xlab(1 "-24" 7 "-18" 13 "-12" 19 "-6" 25 "0" 31 "6" 37 "1
> 2" 43 "18" 49 "24") xline(25, lcolor(gs8) lpattern(dash)) yline(0, lcolor(gs8
> )) xti("Months Since First Civil Enforcement") graphregion(color(white)) bgco
> lor(white) ylab(, angle(0)) yti("Active Firms in District (Logs)")

. qui graph export "${outpath}Figure_11a.pdf", replace

. 
. qui {

. 
. reghdfe lfirm ib99.post_together postpa postcrim, absorb(district month) vce(
> cluster district) // Used in calculations for Table A32
note: 50bn.post_together is probably collinear with the fixed effects (all part
> ialled-out values are close to zero; tol = 1.0e-09)
(MWFE estimator converged in 5 iterations)
note: 50.post_together omitted because of collinearity

HDFE Linear regression                            Number of obs   =     12,143
Absorbing 2 HDFE groups                           F(  26,     86) =      25.84
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.9102
                                                  Adj R-squared   =     0.9082
                                                  Within R-sq.    =     0.0221
Number of clusters (district) =         87        Root MSE        =     0.3645

                              (Std. err. adjusted for 87 clusters in district)
------------------------------------------------------------------------------
             |               Robust
       lfirm | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
post_toget~r |
         50  |          0  (omitted)
         76  |   .0774036   .1320972     0.59   0.559     -.185197    .3400043
         77  |  -.0106337   .1317031    -0.08   0.936    -.2724508    .2511834
         78  |   -.002209   .1268206    -0.02   0.986      -.25432    .2499021
         79  |    .000775   .1302368     0.01   0.995    -.2581272    .2596772
         80  |   .0594567   .1244571     0.48   0.634    -.1879558    .3068692
         81  |   .0688647   .1189553     0.58   0.564    -.1676106      .30534
         82  |   .0651189   .1202386     0.54   0.590    -.1739076    .3041454
         83  |  -.0278085   .1215121    -0.23   0.820    -.2693666    .2137496
         84  |   .0102775   .1049577     0.10   0.922    -.1983716    .2189266
         85  |   .0516346   .0942768     0.55   0.585    -.1357815    .2390506
         86  |   .0463458   .0919828     0.50   0.616      -.13651    .2292016
         87  |    .023264   .1042569     0.22   0.824    -.1839917    .2305198
         88  |   .0663332   .0890826     0.74   0.459    -.1107571    .2434235
         89  |   .0962247   .0948469     1.01   0.313    -.0923247    .2847741
         90  |   .0314441   .0873188     0.36   0.720    -.1421399    .2050281
         91  |   .0775757   .0922462     0.84   0.403    -.1058036    .2609551
         92  |   .0687292   .0935013     0.74   0.464    -.1171453    .2546036
         93  |   .0978026   .0882033     1.11   0.271    -.0775397    .2731449
         94  |   .1040858   .0832928     1.25   0.215    -.0614948    .2696665
         95  |   .0872875   .0791658     1.10   0.273    -.0700889    .2446639
         96  |      .0539   .0662705     0.81   0.418    -.0778414    .1856414
         97  |   .0023583   .0497335     0.05   0.962    -.0965085    .1012252
         98  |  -.0194937   .0373894    -0.52   0.603    -.0938215    .0548341
        100  |   .0122476   .0289675     0.42   0.673    -.0453378     .069833
             |
      postpa |  -.3542165   .1499436    -2.36   0.020    -.6522946   -.0561384
    postcrim |   .2788667   .0881983     3.16   0.002     .1035342    .4541991
       _cons |   1.306038   .0063562   205.47   0.000     1.293402    1.318674
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
    district |        87          87           0    *|
       month |       156           0         156     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. 
. qui {

. 
. *********************************************
. *** Criminal enforcement DD
. 
. qui {

. 
. reghdfe lfirm ib99.reltime_crim2 postpa postciv, absorb(district month) vce(c
> luster district) // Used in Figure A18b
note: 50bn.reltime_crim2 is probably collinear with the fixed effects (all part
> ialled-out values are close to zero; tol = 1.0e-09)
(MWFE estimator converged in 5 iterations)
note: 50.reltime_crim2 omitted because of collinearity

HDFE Linear regression                            Number of obs   =     12,203
Absorbing 2 HDFE groups                           F(  49,     85) =      30.64
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.9124
                                                  Adj R-squared   =     0.9103
                                                  Within R-sq.    =     0.0151
Number of clusters (district) =         86        Root MSE        =     0.3582

                              (Std. err. adjusted for 86 clusters in district)
------------------------------------------------------------------------------
             |               Robust
       lfirm | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
reltime_cr~2 |
         50  |          0  (omitted)
         76  |    .072913   .1141522     0.64   0.525    -.1540521    .2998782
         77  |   .1271983    .107548     1.18   0.240    -.0866359    .3410325
         78  |   .0874526   .1042365     0.84   0.404    -.1197976    .2947028
         79  |   .0930049   .0944955     0.98   0.328    -.0948774    .2808872
         80  |   .1207704   .0945258     1.28   0.205    -.0671721     .308713
         81  |   .0967808   .0965208     1.00   0.319    -.0951285      .28869
         82  |   .1270669   .0984233     1.29   0.200    -.0686249    .3227587
         83  |   .0642974   .0990754     0.65   0.518    -.1326911    .2612859
         84  |   .0451854   .0869197     0.52   0.605    -.1276343     .218005
         85  |   .0117662   .0887722     0.13   0.895    -.1647368    .1882692
         86  |   .0367119   .0791902     0.46   0.644    -.1207394    .1941632
         87  |   .0286275   .0731102     0.39   0.696    -.1167352    .1739902
         88  |   .0494107   .0625704     0.79   0.432     -.074996    .1738175
         89  |   .0434709    .055725     0.78   0.438    -.0673253    .1542671
         90  |   .0020917   .0520698     0.04   0.968    -.1014371    .1056205
         91  |   .0502252   .0476793     1.05   0.295     -.044574    .1450244
         92  |    .110367   .0510829     2.16   0.034     .0088006    .2119335
         93  |   .0458133   .0596966     0.77   0.445    -.0728795     .164506
         94  |    .029368   .0594788     0.49   0.623    -.0888918    .1476278
         95  |   .0106828    .054775     0.20   0.846    -.0982245    .1195902
         96  |   .0454713   .0551036     0.83   0.412    -.0640894    .1550319
         97  |   .0471174   .0344142     1.37   0.175    -.0213073    .1155421
         98  |   .0091867   .0298888     0.31   0.759    -.0502402    .0686135
        100  |   .0364097   .0354587     1.03   0.307    -.0340917     .106911
        101  |   .0516673   .0535329     0.97   0.337    -.0547704     .158105
        102  |   .1021463    .046145     2.21   0.030     .0103977    .1938949
        103  |  -.0715971   .0959169    -0.75   0.457    -.2623056    .1191114
        104  |  -.0036712   .0898744    -0.04   0.968    -.1823656    .1750232
        105  |  -.0984408   .0982272    -1.00   0.319    -.2937429    .0968613
        106  |  -.0322913   .0892632    -0.36   0.718    -.2097705    .1451879
        107  |  -.0207831   .1044684    -0.20   0.843    -.2284942    .1869281
        108  |  -.0500044    .100079    -0.50   0.619    -.2489883    .1489796
        109  |  -.0411717   .0933837    -0.44   0.660    -.2268435    .1445002
        110  |  -.0250933   .0812565    -0.31   0.758     -.186653    .1364664
        111  |   -.015885   .0867005    -0.18   0.855    -.1882689    .1564988
        112  |  -.0667158   .1042731    -0.64   0.524    -.2740386    .1406071
        113  |  -.0477946   .1020576    -0.47   0.641    -.2507125    .1551233
        114  |  -.0785844   .0845014    -0.93   0.355    -.2465958    .0894271
        115  |  -.0526243   .0918225    -0.57   0.568    -.2351921    .1299434
        116  |  -.0965178   .0910468    -1.06   0.292    -.2775432    .0845076
        117  |  -.0891376   .0941329    -0.95   0.346    -.2762991    .0980239
        118  |  -.0865389   .0930002    -0.93   0.355    -.2714481    .0983703
        119  |  -.0622299   .0874095    -0.71   0.478    -.2360234    .1115636
        120  |  -.1038087   .0949337    -1.09   0.277    -.2925623    .0849448
        121  |  -.0849209   .0876011    -0.97   0.335    -.2590954    .0892536
        122  |  -.0561396    .080107    -0.70   0.485    -.2154137    .1031345
        123  |  -.0671494   .0888994    -0.76   0.452    -.2439053    .1096065
             |
      postpa |  -.2690079   .1229196    -2.19   0.031    -.5134051   -.0246107
     postciv |   .3063385   .1390281     2.20   0.030     .0299134    .5827636
       _cons |   1.320012   .0048251   273.57   0.000     1.310419    1.329606
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
    district |        86          86           0    *|
       month |       156           0         156     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. coefplot, vertical baselevels keep(*reltime*) recast(connected) ciopts(recast
> (rcap) color(navy)) xlab(1 "-24" 7 "-18" 13 "-12" 19 "-6" 25 "0" 31 "6" 37 "1
> 2" 43 "18" 49 "24") xline(25, lcolor(gs8) lpattern(dash)) yline(0, lcolor(gs8
> )) xti("Months Since First Criminal Enforcement") graphregion(color(white)) b
> gcolor(white) ylab(, angle(0)) yti("Active Firms in District (Logs)")

. qui graph export "${outpath}Figure_11b.pdf", replace

. 
. qui {

. 
. reghdfe lfirm ib99.post_together postpa postciv, absorb(district month) vce(c
> luster district) // Used in calculations for Table A32
note: 50bn.post_together is probably collinear with the fixed effects (all part
> ialled-out values are close to zero; tol = 1.0e-09)
(MWFE estimator converged in 5 iterations)
note: 50.post_together omitted because of collinearity

HDFE Linear regression                            Number of obs   =     12,203
Absorbing 2 HDFE groups                           F(  26,     85) =       7.23
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.9124
                                                  Adj R-squared   =     0.9104
                                                  Within R-sq.    =     0.0148
Number of clusters (district) =         86        Root MSE        =     0.3580

                              (Std. err. adjusted for 86 clusters in district)
------------------------------------------------------------------------------
             |               Robust
       lfirm | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
post_toget~r |
         50  |          0  (omitted)
         76  |   .0730151   .1137882     0.64   0.523    -.1532264    .2992565
         77  |   .1270165   .1074002     1.18   0.240    -.0865237    .3405568
         78  |   .0871146   .1042663     0.84   0.406    -.1201948    .2944239
         79  |   .0928318   .0944715     0.98   0.329    -.0950027    .2806664
         80  |   .1208109   .0945051     1.28   0.205    -.0670906    .3087124
         81  |   .0966245    .096746     1.00   0.321    -.0957324    .2889814
         82  |   .1271065   .0983169     1.29   0.200    -.0683737    .3225868
         83  |   .0641685   .0989043     0.65   0.518    -.1324798    .2608168
         84  |   .0447961   .0867735     0.52   0.607    -.1277328    .2173251
         85  |   .0117203   .0886563     0.13   0.895    -.1645521    .1879927
         86  |   .0363764   .0792411     0.46   0.647    -.1211761    .1939289
         87  |   .0284109   .0734522     0.39   0.700    -.1176318    .1744537
         88  |   .0492267   .0627855     0.78   0.435    -.0756077    .1740611
         89  |   .0433468   .0556024     0.78   0.438    -.0672057    .1538992
         90  |   .0019581   .0520079     0.04   0.970    -.1014475    .1053638
         91  |   .0500065   .0473528     1.06   0.294    -.0441437    .1441566
         92  |   .1102182    .050859     2.17   0.033     .0090969    .2113396
         93  |   .0456012   .0594211     0.77   0.445    -.0725438    .1637462
         94  |   .0291985   .0593417     0.49   0.624    -.0887888    .1471858
         95  |   .0107038   .0546443     0.20   0.845    -.0979438    .1193514
         96  |   .0456425   .0549985     0.83   0.409    -.0637093    .1549943
         97  |   .0472933   .0346201     1.37   0.176    -.0215408    .1161273
         98  |   .0094356   .0298807     0.32   0.753    -.0499751    .0688464
        100  |  -.0442496   .0731056    -0.61   0.547    -.1896032    .1011039
             |
      postpa |  -.2695659   .1228331    -2.19   0.031    -.5137911   -.0253407
     postciv |   .3068477   .1388611     2.21   0.030     .0307545    .5829408
       _cons |   1.320031    .004832   273.19   0.000     1.310423    1.329638
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
    district |        86          86           0    *|
       month |       156           0         156     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. 
. qui {

. 
. test [est1_mean]100.post_together_civ=[est2_mean]100.post_together_crim // In
> cluded in Table A32

 ( 1)  [est1_mean]100.post_together_civ - [est2_mean]100.post_together_crim = 0

           chi2(  1) =    0.51
         Prob > chi2 =    0.4753

. 
. qui {

. 
. di exp(-0.0442)-1 // Referenced in Section 5.4, Paragraph 1
-.04323741

. 
. log close
      name:  <unnamed>
       log:  /homes/nber/jetson-dua57641/gruber-DUA57641/jetson-dua57641/ambula
> nce/replication/logs/district_regs.log
  log type:  text
 closed on:  16 Jul 2024, 14:49:51
-------------------------------------------------------------------------------
